Don't assume any more that the gtkwidget.c code will queue a redraw on us
authorOwen Taylor <otaylor@gtk.org>
Fri, 5 Feb 1999 15:48:25 +0000 (15:48 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Fri, 5 Feb 1999 15:48:25 +0000 (15:48 +0000)
1999-02-05  Owen Taylor  <otaylor@gtk.org>

* gtk/gtk[hv]paned.c (gtk_[hv]paned_size_allocate):
Don't assume any more that the gtkwidget.c code
will queue a redraw on us during a size_allocate -
queue clear/draws as appropriate for our groove.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkhpaned.c
gtk/gtkvpaned.c

index b996a46549ff6999a21d1d04849856acfbd98e72..c9b3147e7f26af9e2b5605c8e2a0c189dab980cb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+1999-02-05  Owen Taylor  <otaylor@gtk.org>
+
+       * gtk/gtk[hv]paned.c (gtk_[hv]paned_size_allocate): 
+       Don't assume any more that the gtkwidget.c code
+       will queue a redraw on us during a size_allocate -
+       queue clear/draws as appropriate for our groove.
+
 1999-02-04  Christopher Blizzard  <blizzard@redhat.com>
 
        * gtk+.spec (Packager): Change my email address.
index b996a46549ff6999a21d1d04849856acfbd98e72..c9b3147e7f26af9e2b5605c8e2a0c189dab980cb 100644 (file)
@@ -1,3 +1,10 @@
+1999-02-05  Owen Taylor  <otaylor@gtk.org>
+
+       * gtk/gtk[hv]paned.c (gtk_[hv]paned_size_allocate): 
+       Don't assume any more that the gtkwidget.c code
+       will queue a redraw on us during a size_allocate -
+       queue clear/draws as appropriate for our groove.
+
 1999-02-04  Christopher Blizzard  <blizzard@redhat.com>
 
        * gtk+.spec (Packager): Change my email address.
index b996a46549ff6999a21d1d04849856acfbd98e72..c9b3147e7f26af9e2b5605c8e2a0c189dab980cb 100644 (file)
@@ -1,3 +1,10 @@
+1999-02-05  Owen Taylor  <otaylor@gtk.org>
+
+       * gtk/gtk[hv]paned.c (gtk_[hv]paned_size_allocate): 
+       Don't assume any more that the gtkwidget.c code
+       will queue a redraw on us during a size_allocate -
+       queue clear/draws as appropriate for our groove.
+
 1999-02-04  Christopher Blizzard  <blizzard@redhat.com>
 
        * gtk+.spec (Packager): Change my email address.
index b996a46549ff6999a21d1d04849856acfbd98e72..c9b3147e7f26af9e2b5605c8e2a0c189dab980cb 100644 (file)
@@ -1,3 +1,10 @@
+1999-02-05  Owen Taylor  <otaylor@gtk.org>
+
+       * gtk/gtk[hv]paned.c (gtk_[hv]paned_size_allocate): 
+       Don't assume any more that the gtkwidget.c code
+       will queue a redraw on us during a size_allocate -
+       queue clear/draws as appropriate for our groove.
+
 1999-02-04  Christopher Blizzard  <blizzard@redhat.com>
 
        * gtk+.spec (Packager): Change my email address.
index b996a46549ff6999a21d1d04849856acfbd98e72..c9b3147e7f26af9e2b5605c8e2a0c189dab980cb 100644 (file)
@@ -1,3 +1,10 @@
+1999-02-05  Owen Taylor  <otaylor@gtk.org>
+
+       * gtk/gtk[hv]paned.c (gtk_[hv]paned_size_allocate): 
+       Don't assume any more that the gtkwidget.c code
+       will queue a redraw on us during a size_allocate -
+       queue clear/draws as appropriate for our groove.
+
 1999-02-04  Christopher Blizzard  <blizzard@redhat.com>
 
        * gtk+.spec (Packager): Change my email address.
index b996a46549ff6999a21d1d04849856acfbd98e72..c9b3147e7f26af9e2b5605c8e2a0c189dab980cb 100644 (file)
@@ -1,3 +1,10 @@
+1999-02-05  Owen Taylor  <otaylor@gtk.org>
+
+       * gtk/gtk[hv]paned.c (gtk_[hv]paned_size_allocate): 
+       Don't assume any more that the gtkwidget.c code
+       will queue a redraw on us during a size_allocate -
+       queue clear/draws as appropriate for our groove.
+
 1999-02-04  Christopher Blizzard  <blizzard@redhat.com>
 
        * gtk+.spec (Packager): Change my email address.
index b996a46549ff6999a21d1d04849856acfbd98e72..c9b3147e7f26af9e2b5605c8e2a0c189dab980cb 100644 (file)
@@ -1,3 +1,10 @@
+1999-02-05  Owen Taylor  <otaylor@gtk.org>
+
+       * gtk/gtk[hv]paned.c (gtk_[hv]paned_size_allocate): 
+       Don't assume any more that the gtkwidget.c code
+       will queue a redraw on us during a size_allocate -
+       queue clear/draws as appropriate for our groove.
+
 1999-02-04  Christopher Blizzard  <blizzard@redhat.com>
 
        * gtk+.spec (Packager): Change my email address.
index 333ed76ab8893f6804606b05a4042aacb216b824..1eac179b8530322e8290485eae99ca52686b4877 100644 (file)
@@ -133,6 +133,7 @@ gtk_hpaned_size_allocate (GtkWidget     *widget,
   GtkPaned *paned;
   GtkAllocation child1_allocation;
   GtkAllocation child2_allocation;
+  GdkRectangle old_groove_rectangle;
   guint16 border_width;
 
   g_return_if_fail (widget != NULL);
@@ -165,26 +166,37 @@ gtk_hpaned_size_allocate (GtkWidget     *widget,
       gdk_window_move (paned->handle, paned->handle_xpos, paned->handle_ypos);
     }
 
-  if (GTK_WIDGET_MAPPED (widget))
-    {
-      gdk_window_clear_area (widget->window,
-                            paned->groove_rectangle.x,
-                            paned->groove_rectangle.y,
-                            paned->groove_rectangle.width,
-                            paned->groove_rectangle.height);
-    }
-  
   child1_allocation.height = child2_allocation.height = MAX (1, (gint)allocation->height - border_width * 2);
   child1_allocation.width = paned->child1_size;
   child1_allocation.x = border_width;
   child1_allocation.y = child2_allocation.y = border_width;
   
+  old_groove_rectangle = paned->groove_rectangle;
+
   paned->groove_rectangle.x = child1_allocation.x 
     + child1_allocation.width + paned->gutter_size / 2 - 1;
   paned->groove_rectangle.y = 0;
   paned->groove_rectangle.width = 2;
   paned->groove_rectangle.height = allocation->height;
       
+  if (GTK_WIDGET_DRAWABLE (widget) &&
+      ((paned->groove_rectangle.x != old_groove_rectangle.x) ||
+       (paned->groove_rectangle.y != old_groove_rectangle.y) ||
+       (paned->groove_rectangle.width != old_groove_rectangle.width) ||
+       (paned->groove_rectangle.height != old_groove_rectangle.height)))
+    {
+      gtk_widget_queue_clear_area (widget,
+                                  old_groove_rectangle.x,
+                                  old_groove_rectangle.y,
+                                  old_groove_rectangle.width,
+                                  old_groove_rectangle.height);
+      gtk_widget_queue_draw_area (widget,
+                                 paned->groove_rectangle.x,
+                                 paned->groove_rectangle.y,
+                                 paned->groove_rectangle.width,
+                                 paned->groove_rectangle.height);
+    }
+  
   child2_allocation.x = paned->groove_rectangle.x + paned->gutter_size / 2 + 1;
   child2_allocation.width = MAX (1, (gint)allocation->width
     - child2_allocation.x - border_width);
index ff5f25f0ac5fc3540ed5a01c3732687bbc8880a4..15cdc04e295762229a45604705870695535ccf9a 100644 (file)
@@ -133,6 +133,7 @@ gtk_vpaned_size_allocate (GtkWidget     *widget,
   GtkPaned *paned;
   GtkAllocation child1_allocation;
   GtkAllocation child2_allocation;
+  GdkRectangle old_groove_rectangle;
   guint16 border_width;
 
   g_return_if_fail (widget != NULL);
@@ -165,26 +166,37 @@ gtk_vpaned_size_allocate (GtkWidget     *widget,
       gdk_window_move (paned->handle, paned->handle_xpos, paned->handle_ypos);
     }
 
-  if (GTK_WIDGET_MAPPED (widget))
-    {
-      gdk_window_clear_area (widget->window,
-                            paned->groove_rectangle.x,
-                            paned->groove_rectangle.y,
-                            paned->groove_rectangle.width,
-                            paned->groove_rectangle.height);
-    }
-  
   child1_allocation.width = child2_allocation.width = MAX (1, (gint)allocation->width - border_width * 2);
   child1_allocation.height = paned->child1_size;
   child1_allocation.x = child2_allocation.x = border_width;
   child1_allocation.y = border_width;
   
+  old_groove_rectangle = paned->groove_rectangle;
+
   paned->groove_rectangle.y = child1_allocation.y 
     + child1_allocation.height + paned->gutter_size / 2 - 1;
   paned->groove_rectangle.x = 0;
   paned->groove_rectangle.height = 2;
   paned->groove_rectangle.width = allocation->width;
   
+  if (GTK_WIDGET_DRAWABLE (widget) &&
+      ((paned->groove_rectangle.x != old_groove_rectangle.x) ||
+       (paned->groove_rectangle.y != old_groove_rectangle.y) ||
+       (paned->groove_rectangle.width != old_groove_rectangle.width) ||
+       (paned->groove_rectangle.height != old_groove_rectangle.height)))
+    {
+      gtk_widget_queue_clear_area (widget,
+                                  old_groove_rectangle.x,
+                                  old_groove_rectangle.y,
+                                  old_groove_rectangle.width,
+                                  old_groove_rectangle.height);
+      gtk_widget_queue_draw_area (widget,
+                                 paned->groove_rectangle.x,
+                                 paned->groove_rectangle.y,
+                                 paned->groove_rectangle.width,
+                                 paned->groove_rectangle.height);
+    }
+  
   child2_allocation.y = paned->groove_rectangle.y + paned->gutter_size / 2 + 1;
   child2_allocation.height = MAX (1, (gint)allocation->height 
     - child2_allocation.y - border_width);